import { BaseCommand } from '@amcax/base';
import { ImportDialog } from '@app-cad/common/components/import-dialog';
import i18n from 'i18next';
import styled from 'styled-components';

const StyledImportDialog = styled(ImportDialog)`
  & .rjsf > .command-form {
    width: auto !important;
    min-width: 300px !important;
    padding: 20px;
    padding-bottom: 8px;
  }
`;

export const cmdImport: BaseCommand = {
  id: 'CmdImport',
  label: 'command.import',
  icon: 'commands/feature/import',
  noHighlight: true,

  create: (label, onClose) => (
    <StyledImportDialog
      title={i18n.t(label)}
      onClose={onClose}
    />
  ),
};
